package com.gxa.xly2024.controller;


import com.gxa.xly2024.pojo.PurchaseXinxi;
import com.gxa.xly2024.pojo.SellXinxi;
import com.gxa.xly2024.service.impl.PurchaseXinxiServiceImpl;
import com.gxa.xly2024.service.impl.SellXinxiServiceImpl;
import com.gxa.xly2024.vo.VO;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;


@RestController
@RequestMapping("/sellXinxi")
public class SellXinxiController {

    @Resource
    private SellXinxiServiceImpl sellXinxiService;

    @GetMapping("/selectSellXinxiById")
    public Map<String, Object> selectSell(Integer id) {
        return this.sellXinxiService.selectSellXinxiById(id);
    }

    @GetMapping("/selectSellXinxiByLimit")
    public Map<String, Object> selectSellByLimit(VO vo) {
        return this.sellXinxiService.selectSellXinxiByLimit(vo);
    }

    @PostMapping("/insert_SellXinxi")
    public Map<String, Object> insert(@RequestBody SellXinxi sellXinxi) {   // 接收前端传递的json对象
        return this.sellXinxiService.insert(sellXinxi);
    }

    @PostMapping("/updateById_SellXinxi")
    public Map<String, Object> updateById(@RequestBody SellXinxi sellXinxi) {   // 接收前端传递的json对象
        return this.sellXinxiService.updateById(sellXinxi);
    }
    @PostMapping("/deleteById_SellXinxi")
    public Map<String, Object> deleteById(Integer id) {   // 接收前端传递的json对象
        return this.sellXinxiService.deleteById(id);
    }
}

